home *** CD-ROM | disk | FTP | other *** search
-
- function units_helicopter_tr_human_setup()
- units_setup(2,true,ENET_EFFECT_PS_SETUPSMOKE_MEDIUM,ENET_EFFECT_GEOMETRY_HELICOPTERALIENSHADOW,true)
- local unit = uniGetExecutor()
- unit:getBone(ENBT_FAN,0):addRotationEffect(ENET_EFFECT_ROTATE_RADAR,MATH_PI / 2)
- unit:getBone(ENBT_FAN,1):addRotationEffect(ENET_EFFECT_ROTATE_RADAR,MATH_PI / 2)
- unit:getBone(ENBT_FAN,0):addSimpleEffect(ENET_EFFECT_BINDEDSPRITE_HELICOPTERALIENPROPELLER2)
- unit:getBone(ENBT_FAN,1):addSimpleEffect(ENET_EFFECT_BINDEDSPRITE_HELICOPTERALIENPROPELLER)
- unit:addSimpleEffect(ENET_EFFECTEMITTER_HELICOPTERWATERWAVES)
- unit:addSimpleEffect(ENET_EFFECT_HELICOPTER_WATERWAVES2)
- end
-
- function units_helicopter_tr_human_resetup()
- units_setup(2,true,nil,ENET_EFFECT_GEOMETRY_HELICOPTERALIENSHADOW,true)
- local unit = uniGetExecutor()
- unit:getBone(ENBT_FAN,0):addRotationEffect(ENET_EFFECT_ROTATE_RADAR,MATH_PI / 2)
- unit:getBone(ENBT_FAN,1):addRotationEffect(ENET_EFFECT_ROTATE_RADAR,MATH_PI / 2)
- unit:getBone(ENBT_FAN,0):addSimpleEffect(ENET_EFFECT_BINDEDSPRITE_HELICOPTERALIENPROPELLER2)
- unit:getBone(ENBT_FAN,1):addSimpleEffect(ENET_EFFECT_BINDEDSPRITE_HELICOPTERALIENPROPELLER)
- unit:addSimpleEffect(ENET_EFFECTEMITTER_HELICOPTERWATERWAVES)
- unit:addSimpleEffect(ENET_EFFECT_HELICOPTER_WATERWAVES2)
- end
-
- function units_helicopter_tr_human_select()
- units_select(12,1)
- end
-
- function units_helicopter_tr_human_unselect()
- units_unselect()
- end
-
- function units_helicopter_tr_human_selectenemy()
- uniGetExecutor():addSimpleEffect(ENET_EFFECT_SELECTEDGEOMETRY_ENEMY)
- end
-
- function units_helicopter_tr_human_damaged()
- uniGetExecutor():applyDamage(uniGetLife())
- end
-
- function units_helicopter_tr_human_highlight()
- uniGetExecutor():addEffectWithRadius(ENET_EFFECT_GEOMETRY_HIGHLIGHT,15)
- end
-
- function units_helicopter_tr_human_explode()
- uniGetExecutor():getBone(ENBT_FAN,1):findEffect(ENET_EFFECT_BINDEDSPRITE_HELICOPTERALIENPROPELLER):destroy()
- units_explode_fire()
- end
-
- function units_helicopter_tr_human_fire()
- end
-
- function units_helicopter_tr_human_move()
- local unit = uniGetExecutor()
- local mover = unit:helicopterMover()
- if (mover~=false) then waitDeath(mover) end
-
- -- local sound = unit:play3DSound("chopper.wav",1)
- --waitDeath(unit:helicopterFly(uniGetPosition()))
- unit:helicopterFly(uniGetPosition())
- -- sound:destroy()
- end
-
- function units_helicopter_tr_human_load()
- local unit = uniGetExecutor()
- local cargo = uniGetTarget()
- units_waitCommandByUID(cargo,unit:getCurrentCommandUID() - 1)
- unit:play3DSound("chopper fade.wav",0)
- local hPos = unit:getHelicopterTarget()
- waitDeath(unit:helicopterFly(cargo:getWorldPosition()))
- unit:play3DSound("dragon load.wav",0)
- uniSetPosition(unit:getBone(ENBT_FIRE1):getWorldPosition())
- -- local sound = unit:play3DSound("chopper.wav",1)
- cargo:setTransformOwner(units_findfreefirespot(unit,1))
- cargo:setVisibility(true,true)
- cargo:setLocalPosition(0,0,0)
- cargo:setLocalOrientation(0,1,0,0,0,1)
- unit:helicopterFly(hPos)
- -- waitDeath(unit:helicopterFly(hPos))
- -- sound:destroy()
- cargo:terminateCommand()
- end
-
- function units_helicopter_tr_human_unload()
- local unit = uniGetExecutor()
- local cargo = uniGetTarget()
- units_waitCommandByUID(cargo,unit:getCurrentCommandUID() - 1)
- local hPos = unit:getHelicopterTarget()
- unit:play3DSound("chopper fade.wav",0)
- waitDeath(unit:helicopterFly(uniGetPosition()))
- unit:play3DSound("dragon load.wav",0)
- cargo:setTransformOwner()
- -- local sound = unit:play3DSound("chopper.wav",1)
- unit:helicopterFly(hPos)
- -- sound:destroy()
- cargo:terminateCommand()
- end
-
- function units_helicopter_tr_human_transfer()
- local unit = uniGetExecutor()
- local cargo = uniGetTarget()
- units_waitCommandByUID(cargo,unit:getCurrentCommandUID() - 1)
- local from = cargo:getTransformOwner():getTransformOwner()
- local fromType = from:getEffectType()
- units_waitCommandByUID(from,unit:getCurrentCommandUID() - 2)
- if(fromType == ENET_UNIT_TRANSCHOPPER_HUMAN) then
- waitDeath(from:parabolicTargetting(unit))
- cargo:setTransformOwner()
- units_helicopter_tr_human_load()
- from:setCurrentAnimationRepeatCount(0)
- from:terminateCommand()
- elseif(fromType == ENET_UNIT_LANDTRANSPORT or fromType == ENET_UNIT_SEATRANSPORT) then
- waitDeath(from:parabolicTargetting(unit))
- cargo:setTransformOwner()
- from:addAnimationToQueue(ENAT_PREPAREFORFIRE1,1)
- from:addAnimationToQueue(ENAT_FIREPOSITION1,MATH_INFINITY)
- from:addAnimationToQueue(ENAT_AFTERFIRE1,1)
- units_unload_growth(cargo)
- cargo:setTransformOwner()
- cargo:setVisibility(true,false)
- units_helicopter_tr_human_load()
- from:setCurrentAnimationRepeatCount(0)
- from:terminateCommand()
- else
- consoleWrite("attempt to reload from unknown transport type!!!")
- end
- end
-
- registerCommand(ENSCRIPTSET_TRANSCHOPPER_HUMAN,ENC_MOVE,"units_helicopter_tr_human_move")
- registerCommand(ENSCRIPTSET_TRANSCHOPPER_HUMAN,ENC_FIRE1,"units_helicopter_tr_human_fire")
- registerCommand(ENSCRIPTSET_TRANSCHOPPER_HUMAN,ENC_FIRE2,"units_helicopter_tr_human_fire")
- registerCommand(ENSCRIPTSET_TRANSCHOPPER_HUMAN,ENC_SELECT,"units_helicopter_tr_human_select")
- registerCommand(ENSCRIPTSET_TRANSCHOPPER_HUMAN,ENC_SELECTENEMY,"units_helicopter_tr_human_selectenemy")
- registerCommand(ENSCRIPTSET_TRANSCHOPPER_HUMAN,ENC_UNSELECT,"units_helicopter_tr_human_unselect")
- registerCommand(ENSCRIPTSET_TRANSCHOPPER_HUMAN,ENC_SETUP,"units_helicopter_tr_human_setup")
- registerCommand(ENSCRIPTSET_TRANSCHOPPER_HUMAN,ENC_RESETUP,"units_helicopter_tr_human_resetup")
- registerCommand(ENSCRIPTSET_TRANSCHOPPER_HUMAN,ENC_DAMAGED,"units_helicopter_tr_human_damaged")
- registerCommand(ENSCRIPTSET_TRANSCHOPPER_HUMAN,ENC_EXPLODE,"units_helicopter_tr_human_explode")
- registerCommand(ENSCRIPTSET_TRANSCHOPPER_HUMAN,ENC_HIGHLIGHT,"units_helicopter_tr_human_highlight")
- registerCommand(ENSCRIPTSET_TRANSCHOPPER_HUMAN,ENC_LOAD,"units_helicopter_tr_human_load")
- registerCommand(ENSCRIPTSET_TRANSCHOPPER_HUMAN,ENC_UNLOAD,"units_helicopter_tr_human_unload")
- registerCommand(ENSCRIPTSET_TRANSCHOPPER_HUMAN,ENC_TRANSFER,"units_helicopter_tr_human_transfer")
- registerCommand(ENSCRIPTSET_TRANSCHOPPER_HUMAN,ENC_INSIDE,"units_inside")
-
- -- make description of unit
- desc = getEffectDescriptionP(ENET_UNIT_TRANSCHOPPER_HUMAN)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "dragonfly.rmd"
- desc.ScriptSet = ENSCRIPTSET_TRANSCHOPPER_HUMAN
- desc.MoveType = ENMOVE_FLYCONSTANTHEIGHT
- --desc.MoveType = ENMOVE_GROUND
- desc.RenderType = ENRENDERTYPE_GEOMETRY
- desc.Material = ENMAT_RIGIDSKINNEDMESH
- desc.MaterialColors = units_materialcolors_human
- desc.isPlacesVisible = true
-
- -- shadow
- desc = getEffectDescriptionP(ENET_EFFECT_GEOMETRY_HELICOPTERALIENSHADOW)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "dragonfly.rmd"
- desc.RenderType = ENRENDERTYPE_SHADOW
- desc.Material = ENMAT_SHADOW
- desc.MaterialColors = units_materialcolors_shadow
-
- -- register new unit to logic
- unitDesc = logic_getUnitDescP(39)
- unitDesc.group = 2
- unitDesc.order = 2
- unitDesc.unit_res_id = ENET_UNIT_TRANSCHOPPER_HUMAN
- unitDesc.unit_icon_id = "Dragonfly_h_small_normal.dds"
- unitDesc.active_id = "Dragonfly_h_small_active.dds"
- unitDesc.pressed_id = "Dragonfly_h_small_pressed.dds"
- unitDesc.big_icon_id = "Dragonfly_h_big_normal.dds"
- unitDesc.small_icon_id = "Dragonfly_l_human_stats.dds"
- unitDesc.HP = 3
- unitDesc.MP = 40
- unitDesc.WR = 0
- unitDesc.min_WR = 0
- unitDesc.WD = 0
- unitDesc.WR2 = 0
- unitDesc.min_WR2 = 0
- unitDesc.WD2 = 0
- unitDesc.ability = 5
- unitDesc.transport = 1
- unitDesc.value = 2
- unitDesc.race = 0
- unitDesc.fire_pause = 0.6
- unitDesc.move_pause = 0.5
- unitDesc.unit_info_scale = 0.07
- unitDesc.scn_name = "TRANSPCHOPPERH"
-